#ifndef SIIM_VIEW_H
#define SIIM_VIEW_H

#include <QtWidgets/QMainWindow>
#include "ui_siim_view.h"
#include "Siim_Define.h"
class QAction;
class QMenu;
class QMdiArea;
class QMdiSubWindow;
class QSignalMapper;
class QSiimPlot;
class QMainView;
class CSiimData;
class QToolBox;
class QButtonGroup;
class QToolButton;
class SiimConfig;
class QLCDNumber;
class Siim_View : public QMainWindow
{
	Q_OBJECT

public:
	Siim_View(QWidget *parent = 0);
	~Siim_View();

private:
	Ui::Siim_ViewClass ui;

protected:
	void closeEvent(QCloseEvent *event);
	void timerEvent( QTimerEvent *e );
private slots:
//	void updateMenus();
	void updateWindowMenu();
	QSiimPlot *createMdiChild(int id,SiimDataType dataType);

	void switchLayoutDirection();
	void setActiveSubWindow(QWidget *window);
	void ShowMainView();
	void ShowConfigDlg();
	void buttonGroupClicked(int id);
	void buttonGroupClicked_Sensor(int id);
	void showTime();
private:
	void createActions();
	void createMenus();
	void createToolBars();
	void createStatusBar();
	void createToolBox();
	void createSensorBox();
	void createDockWindows();
	QSiimPlot *activeMdiChild();
	QMdiSubWindow *findMdiChild(const QString &fileName);
	QLCDNumber *pLcd;
	QMainView *mainview;
	CSiimData *SiimData;
	QMdiArea *mdiArea;
	QSignalMapper *windowMapper;

	QMenu *fileMenu;
	QMenu *editMenu;
	QMenu *windowMenu;
	QMenu *helpMenu;
	QToolBar *fileToolBar;
	QToolBar *editToolBar;
	QAction *newAct;
	QAction *openAct;
	QAction *saveAct;
	QAction *configAct;
	QAction *saveAsAct;
	QAction *exitAct;

	QAction *closeAct;
	QAction *closeAllAct;
	QAction *tileAct;
	QAction *cascadeAct;
	QAction *nextAct;
	QAction *previousAct;
	QAction *separatorAct;
	QAction *aboutAct;
	QAction *aboutQtAct;

	QToolBox *toolBox;
	QToolBox *sensorBox;
	QButtonGroup *buttonGroup;
	QButtonGroup *sensorbuttonGroup;
	QButtonGroup *pointerTypeGroup;
	QButtonGroup *backgroundButtonGroup;
	QButtonGroup *statecheckGroup;
	QButtonGroup *statecheck2Group;
	QToolButton *fontColorToolButton;
	QToolButton *fillColorToolButton;
	QToolButton *lineColorToolButton;
	QWidget *createCellWidget(int  type,SiimDataType dataType);
	QWidget *createCheckWidget(int  type,SiimDataType dataType);
	
	QSiimPlot *childRTStateArray[STATEDATASIZE];
	QSiimPlot *sensorRTStateArray[STATEDATASIZE];
	QSiimPlot *abcRTStateArray[STATEDATASIZE];
};

#endif // SIIM_VIEW_H
